package edu.java.lectures.lec04.inheritance;

public class ScaleneTriangle extends IsoscelesTriangle {
    
    // --- Instance Variables --------------------------------------------------
    
    double c;
    
    // --- Constructors --------------------------------------------------------
    public ScaleneTriangle() {
    }
    
    public ScaleneTriangle(double a, double b, double c) {
	super(a,b);
	this.a=a;
	this.b=b;
	this.c=c;
    }
    
    // --- Getters and Setters -------------------------------------------------
    public double getC(){
	return c;
    }
    
    public void setC(double c){
	this.c=c;
    }
    
    // --- Methods -------------------------------------------------------------
    
    // overriding the necessary methods from the super class
    
    @Override
    public double calculatePerimeter(){
	return a+b+c;
    }
    
    @Override
    public double calculateSurface(){
	double semiP= calculatePerimeter()/2;
	return Math.sqrt(semiP*(semiP-a)*(semiP-b)*(semiP-c));
    }
    
    @Override
    public String toString(){
	
	//test 1
//	System.out.println(super.toString());
	
	// test 2
//	System.out.println(getA());
//	System.out.println(this.getA());
//	System.out.println(super.getA());
	
	
	return "("+a+", "+b+", "+c+")";
    }
    
    public String toString(String printMessage){
	return "Message: "+ printMessage;
    }
    
}
